1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method and an image processing program. More particularly, the present invention relates to an image processing apparatus capable of improving the precision of an operation carried out thereby to detect a motion vector by improving the precision of candidate vectors to be extracted, an image processing method to be adopted by the apparatus and an image processing program implementing the method.
2. Description of the Related Art
With recent progress of signal processing carried out on a moving image, a technology for detection of a motion vector of every object on an image is applied to a variety of fields. For example, the technology for detection of a motion vector of every object on an image is used in movement-compensation type encoding carried out as high-performance encoding, frame-rate conversion of a moving image, processing to detect a moving object in a traffic monitoring system, movement detection processing, etc. A technology for detecting a disparity vector from images appearing at a plurality of points is applied to detection of a moving object from images taken by making use of stereo cameras, depth measurements, etc. Detection of a motion vector of a moving image and detection of a disparity vector of each of images appearing at a plurality of points are different from each other only in that the detections merely have different relations between images used for establishing association. From the technological point of view, the detection of a motion vector of a moving image is same with the detection of a disparity vector of each of images appearing at a plurality of points. For this reason, the detection of a motion vector of a moving image and the detection of a disparity vector of each of images appearing at a plurality of points are both referred to as vector detection.
In the past, a block matching technique is widely adopted in the vector detection. In accordance with the block matching technique, an overall search operation is carried out in order to compare all pieces of data in a search area. Thus, the block matching technique has a demerit that the number of comparisons to be carried out in the comparison of all pieces of data in a search area is large and, thus, the long time is required to perform the vector detection.
In addition, if a block includes a plurality of portions with different movement directions, a movement detected with the block taken as a unit representing individual movements in the block cannot be said to be a movement detected with a high degree of accuracy. Such a problem can be solved by setting the size of the block at a properly adjusted value. If the size of the block is set at an excessively large value, the amount of computation increases. In addition, with the size of the block set at an excessively large value, a problem caused by a plurality of movements in the block is tend to be raised. If the size of the block is set at an excessively small value so as to prevent the block from including a plurality of movements, the size of an area used for determination of a matching state decreases. Thus, in this case, there is raised a problem that the precision of the movement detection deteriorates.
In order to solve the problems described above, inventor of the present invention has proposed a motion-vector detection apparatus capable of detecting a motion vector for every pixel without increasing the amount of computation and capable of avoiding incorrect motion-vector detection and a motion-vector detection method to be adopted by the motion-vector detection apparatus described in Japanese Patent Laid-open Nos. 2005-175869 (as Patent Document 1) and 2005-175870 (as Paten Document 2).
In accordance with points described in Patent Documents 1 and 2 as points of the motion-vector detection method, an evaluation value is computed for every pixel or every block of pixels. In this case, however, a motion vector is not determined directly. Instead, the problems raised in the past are solved by adoption of a candidate-vector method. In accordance with the candidate-vector method, first of all, as a first step, an evaluation-value table is generated for an image by adoption of a representative-point matching technique and some candidate vectors are extracted from the generated evaluation-value table. Then, as a second step, for every pixel, a candidate vector considered to be the best is selected from the candidate vectors. The selected candidate vector is taken as a motion vector. In this way, a motion vector can be decided for every pixel.
In accordance with the candidate-vector method, only effective positions (that is, the positions of candidate vectors) in a search area are extracted at the first step in order to reduce the amount of computation. It is quite within the bounds of probability that, on a boundary of an image taking subject, incorrect vector detection is carried out inadvertently. Also for such a boundary of an image taking subject, a best vector is determined from few candidate vectors which have been determined in advance after the number of candidate vectors has been reduced. Thus, in comparison with an operation to search the entire search area, the probability of resulting in the same evaluation value for different pixels is low and the probability of the incorrect vector detection is also reduced as well.